from django.urls import path, re_path

from . import views

app_name = 'cms'
urlpatterns = [
    # index
    path('', views.index, name='index'),
    # posts
    path('posts/', views.post_list, name='posts'),
    path('posts/edit/', views.PostEditView.as_view(), kwargs={"pid": None}, name='posts_add'),
    re_path('posts/edit/(?P<pid>[0-9a-zA-Z]{22})/', views.PostEditView.as_view(), name='posts_edit'),
    path('recommend/', views.change_recommend, name='change_recommend'),  # 更改推荐
    path('category/', views.CategoryView.as_view(), name='posts_category'),
    path('tags/', views.TagView.as_view(), name='posts_tag'),
    # focus
    path('focus/', views.FocusView.as_view(), name='focus'),
    # talk
    path('talks/', views.talk_list, name='talks'),
    path('talks/edit/', views.TalkEditView.as_view(), name='talks_add'),
    path('mood/', views.MoodView.as_view(), name='talks_mood'),
    # friends
    path('friends/', views.FriendsView.as_view(), name='friends'),
    # utils
    path('upload/', views.upload, name='upload'),
]
